﻿using System;
using Telerik.Web.UI;

public partial class ltMan_infos_infosList : AdminBasePage
{
    ltModel.BLL.TableDownload tdown = new ltModel.BLL.TableDownload();

    protected void Page_Load(object sender, EventArgs e)
    {
        SqlPager pager = new SqlPager("lt_TableDownload", "id", "*");
        if (!string.IsNullOrEmpty(sName.Text))
            pager.Where = " tname like '%" + sName.Text.Replace("'", "''") + "%'";
        pager.OrderBy = "addtime desc";
        RadGridBinder.Create(RadGrid1, pager);
    }
    protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        int id = int.Parse(GridCommander.ExtractValue(e, "id"));
        OperateLog.AddSuccessLog(CurrentUser.user_id, Request.UserHostAddress, "资料下载-删除>" + tdown.GetModel(id).tname);
        tdown.Delete(id);
    }
    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "Verify")
        {
            string ids = GridCommander.JoinValues(e.Item.OwnerTableView.DataKeyValues, RadGrid1.SelectedIndexes);
            OperateLog.AddSuccessLog(CurrentUser.user_id, Request.UserHostAddress, "资料下载-修改审核>" + ids);
            tdown.UpdateZT(ids, e.CommandArgument.ToString());
            RadGrid1.Rebind();
        }
    }
    protected void b1_Click(object sender, EventArgs e)
    {
        RadGrid1.Rebind();
    }
}